<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<div class="span12 box-content">
	<div class="span12">共有${courseCount}条数据,${totalPage }页</div>
	<table class="table table-striped table-bordered" >
		<thead>
		 <tr>
		 	<th>课程编号</th>
		 	<th>课程名称</th>
		 	<th>行课周数</th>
		 	<th>课程分类</th>
		 	<th>课程学分</th>
		 	<th>行课学期</th>
		 	<th>教学计划</th>
		 	<th>操作</th>
		 </tr>
		</thead>
		<tbody>
		<c:forEach items="${courseList }" var="c">
			<tr>
				<td>${c.courseId }</td>
				<td>${c.name }</td>
				<td>${c.weeknum }</td>
				<td>${c.category}</td>
				<td>${c.credit}</td>
				<td>${c.term }</td>
				<td><c:if test="${!(empty c.teachPlan) }"><a href="${c.teachPlan }" class="btn btn-info">下载</a></c:if></td>
				<td>
					<button class="btn btn-info course_edit" data-courseId="${c.id }"  data-target="#course_edit_box" data-toggle="modal" >修改</button>
					<button class="btn btn-info course_file_edit" data-courseId="${c.id }"  data-target="#course_file_upload_box" data-toggle="modal" >修改教学计划</button>
					<button class="btn btn-danger course_delete"data-courseId="${c.id }"  data-target="#course_delete_box" data-toggle="modal" >删除课程</button>
				</td>
			</tr> 
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination  pagination-centered"
			data-totalPage="${totalPage }" 
			data-currentPage="${page }" 
			data-url="<%=basePath%>admin/teach/showCourseList/{page}"
			style="display:none">
	</div>
	<div class="well">
		<button type="button" class="btn btn-primary" id="course_add" data-target="#course_add_box" data-toggle="modal" >
			<i class=" icon-plus icon-white"></i>  
			新建一个课程
		</button>
	</div>
</div>
<!--  课程修改 开始 -->
<div class="modal hide fade" id="course_edit_box">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal">×</button>
		<h3>编辑课程信息</h3>
	</div>
	<div class="modal-body">
		<form class="form-horizontal">
		<input type="hidden" name="id"  >
		<div class="control-group">
				<label class="control-label">课程编号:</label>
				<div class="controls">
					<input name="courseId" type="text" >
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">课程名称:</label>
				<div class="controls">
					<input name="name" type="text" >
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">行课周数:</label>
				<div class="controls">
					<input name="weeknum" type="text" >
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">课程分类:</label>
				<div class="controls">
					<input name="category" type="text" >
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">课程学分:</label>
				<div class="controls">
					<input name="credit" type="text" >
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">行课学期:</label>
				<div class="controls">
					<input name="term" type="text" >
				</div>
			</div>
		</form>
	</div>
	<div class="modal-footer">
		<a href="#" class="btn" data-dismiss="modal">取消</a>
		<a href="#" class="btn btn-primary" id="course_edit_box_save">保存</a>
	</div>
</div>
<!-- 课程修改 结束 -->
<!-- 上传 开始-->
<div class="modal hide fade" id="course_file_upload_box">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal">×</button>
		<h3>修改教学计划</h3>
	</div>
	<div class="modal-body">
		<div id="course_file_upload_box_alert_container" ></div><br/>
		<input type="hidden" name="id"  >
		<span class="btn btn-success fileinput-button" id="course_file_upload_box_file">
			<span>选择文件</span>
			<input type="file" name="file"  >
		</span>
		<span id="course_file_upload_box_file_name">未选择</span>
		<div class="progress progress-info progress-striped" style="margin-top: 3%;display:none" id="course_file_upload_box_progress">
				<div class="bar" style="width: 0%" ></div>
		</div>
	</div>
	<div class="modal-footer">
		<a href="#" class="btn" data-dismiss="modal">取消</a>
		<a href="#" class="btn btn-primary" id="course_file_upload_box_file_confirm">确定</a>
	</div>
</div>
<!-- 上传 结束 -->
<!-- 删除确认 开始-->
<div class="modal hide fade" id="course_delete_box">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal">×</button>
		<h3>删除课程</h3>
	</div>
	<div class="modal-body">
		<input type="hidden" name="id"/>
            确认删除?删除动作不可撤销!
	</div>
	<div class="modal-footer">
		<a href="#" class="btn" data-dismiss="modal">取消</a>
		<a href="#" class="btn btn-danger" id="course_delete_box_delete">删除</a>
	</div>
</div>
<!-- 删除确认 结束 -->
<!--  课程添加 开始 -->
<div class="modal hide fade" id="course_add_box">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal">×</button>
		<h3>添加一个课程</h3>
	</div>
	<div class="modal-body">
		<form class="form-horizontal">
		<div class="control-group">
				<label class="control-label">课程编号:</label>
				<div class="controls">
					<input name="courseId" type="text" >
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">课程名称:</label>
				<div class="controls">
					<input name="name" type="text" >
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">行课周数:</label>
				<div class="controls">
					<input name="weeknum" type="text" >
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">课程分类:</label>
				<div class="controls">
					<input name="category" type="text" >
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">课程学分:</label>
				<div class="controls">
					<input name="credit" type="text" >
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">行课学期:</label>
				<div class="controls">
					<input name="term" type="text" >
				</div>
			</div>
		</form>
	</div>
	<div class="modal-footer">
		<a href="#" class="btn" data-dismiss="modal">取消</a>
		<a href="#" class="btn btn-primary" id="course_add_box_save">保存</a>
	</div>
</div>
<!-- 课程添加 结束 -->